﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Data;
using System.Windows;
using SPIWareMVVM.ViewModels;

namespace SPIWareMVVM.Views.Conversions
{
    public class BoolToVisibilityConverter : IValueConverter
    {
        public object Convert(object value, Type targetType,
            object parameter, System.Globalization.CultureInfo culture)
        {
            if (parameter != null && ((ObjectDataProvider)parameter).ObjectInstance.GetType().Name == "ApplicationViewModel")
            {
                ApplicationViewModel vm = (ApplicationViewModel)((ObjectDataProvider)parameter).ObjectInstance;

            }
            bool val = (bool)value;
            return val ? Visibility.Visible : Visibility.Collapsed;
        }

        public object ConvertBack(object value, Type targetType,
            object parameter, System.Globalization.CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
    public class CanUserSeeConverter : IMultiValueConverter
    {
        public object Convert(object[] values, Type targetType, object parameter,
            System.Globalization.CultureInfo culture)
        {
            if (values.Count() == 2
                && values[0].ToString() != "{DependencyProperty.UnsetValue}"
                && values[1].ToString() != "{DependencyProperty.UnsetValue}")
            {
                object o = null;
            }
            return string.Empty;
        }
        public object[] ConvertBack(object value, Type[] targetTypes, object parameter,
            System.Globalization.CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
